﻿/*
* 
*
* 功 能： N/A
* 类 名： BDVALUE
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* 
*/
using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using DQYT.HTDZ.IDAL;
using Maticsoft.DBUtility;
using DQYT.HTDZ.Model;

namespace DQYT.HTDZ.OracleDAL
{
    /// <summary>
    /// 数据访问类:BDVALUE
    /// </summary>
    public partial class BDVALUEDAL : IBDVALUE
    {
        public BDVALUEDAL()
        { }
        #region  BasicMethod

        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(decimal ID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from BDVALUE");
            strSql.Append(" where ID=:ID ");
            OracleParameter[] parameters = {
					new OracleParameter(":ID", OracleType.Number,22)			};
            parameters[0].Value = ID;

            return DbHelperOra.Exists(strSql.ToString(), parameters);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(BDVALUEModel model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into BDVALUE(");
            strSql.Append("ID,WELLID,KSSJ,JCRQ,JSSJ,DDJEDGL,DDJEDZS,CYJCC,CYJCCI,SXDLMAX,XXDLMAX,DDZDZPHD,SXYGPJZ,XXYGPJZ,YGPJZPHD,SXYGMAX,XXYGMAX,YGZDZPHD,SXNJJFG,XXNJJFG,NJJFGPHD,RWGNH,RYGZNH,RYGFNH,PJGLYS,PJYGGL,PJWGGL,PJSZGL,PJXDY,PJXIDY,YGFZL,YGPZL,NJFZL,NJPZL,DMXL,XTXL,DYNH,RCYL,BJ,HS,DYM,CMD,BX,YY,TY,BS,LLPL,RCYOL,PHKSL,PHDWZ1,PHDWZ2,PHDWZ3,PHDWZ4,PHKZL1,PHKZL2,PHKZL3,PHKZL4,BZ)");
            strSql.Append(" values (");
            strSql.Append("HTDZ_ID.nextval,:WELLID,:KSSJ,:JCRQ,:JSSJ,:DDJEDGL,:DDJEDZS,:CYJCC,:CYJCCI,:SXDLMAX,:XXDLMAX,:DDZDZPHD,:SXYGPJZ,:XXYGPJZ,:YGPJZPHD,:SXYGMAX,:XXYGMAX,:YGZDZPHD,:SXNJJFG,:XXNJJFG,:NJJFGPHD,:RWGNH,:RYGZNH,:RYGFNH,:PJGLYS,:PJYGGL,:PJWGGL,:PJSZGL,:PJXDY,:PJXIDY,:YGFZL,:YGPZL,:NJFZL,:NJPZL,:DMXL,:XTXL,:DYNH,:RCYL,:BJ,:HS,:DYM,:CMD,:BX,:YY,:TY,:BS,:LLPL,:RCYOL,:PHKSL,:PHDWZ1,:PHDWZ2,:PHDWZ3,:PHDWZ4,:PHKZL1,:PHKZL2,:PHKZL3,:PHKZL4,:BZ)");
            OracleParameter[] parameters = {
					new OracleParameter(":WELLID", OracleType.VarChar,30),
					new OracleParameter(":KSSJ", OracleType.DateTime),
					new OracleParameter(":JCRQ", OracleType.DateTime),
					new OracleParameter(":JSSJ", OracleType.DateTime),
					new OracleParameter(":DDJEDGL", OracleType.Float,22),
					new OracleParameter(":DDJEDZS", OracleType.Float,22),
					new OracleParameter(":CYJCC", OracleType.Float,22),
					new OracleParameter(":CYJCCI", OracleType.Float,22),
					new OracleParameter(":SXDLMAX", OracleType.Float,22),
					new OracleParameter(":XXDLMAX", OracleType.Float,22),
					new OracleParameter(":DDZDZPHD", OracleType.Float,22),
					new OracleParameter(":SXYGPJZ", OracleType.Float,22),
					new OracleParameter(":XXYGPJZ", OracleType.Float,22),
					new OracleParameter(":YGPJZPHD", OracleType.Float,22),
					new OracleParameter(":SXYGMAX", OracleType.Float,22),
					new OracleParameter(":XXYGMAX", OracleType.Float,22),
					new OracleParameter(":YGZDZPHD", OracleType.Float,22),
					new OracleParameter(":SXNJJFG", OracleType.Float,22),
					new OracleParameter(":XXNJJFG", OracleType.Float,22),
					new OracleParameter(":NJJFGPHD", OracleType.Float,22),
					new OracleParameter(":RWGNH", OracleType.Float,22),
					new OracleParameter(":RYGZNH", OracleType.Float,22),
					new OracleParameter(":RYGFNH", OracleType.Float,22),
					new OracleParameter(":PJGLYS", OracleType.Float,22),
					new OracleParameter(":PJYGGL", OracleType.Float,22),
					new OracleParameter(":PJWGGL", OracleType.Float,22),
					new OracleParameter(":PJSZGL", OracleType.Float,22),
					new OracleParameter(":PJXDY", OracleType.Float,22),
					new OracleParameter(":PJXIDY", OracleType.Float,22),
					new OracleParameter(":YGFZL", OracleType.Float,22),
					new OracleParameter(":YGPZL", OracleType.Float,22),
					new OracleParameter(":NJFZL", OracleType.Float,22),
					new OracleParameter(":NJPZL", OracleType.Float,22),
					new OracleParameter(":DMXL", OracleType.Float,22),
					new OracleParameter(":XTXL", OracleType.Float,22),
					new OracleParameter(":DYNH", OracleType.Float,22),
					new OracleParameter(":RCYL", OracleType.Float,22),
                    new OracleParameter(":BJ", OracleType.Float,22),
					new OracleParameter(":HS", OracleType.Float,22),
					new OracleParameter(":DYM", OracleType.Float,22),
					new OracleParameter(":CMD", OracleType.Float,22),
					new OracleParameter(":BX", OracleType.Float,22),
					new OracleParameter(":YY", OracleType.Float,22),
					new OracleParameter(":TY", OracleType.Float,22),
					new OracleParameter(":BS", OracleType.Float,22),
					new OracleParameter(":LLPL", OracleType.Float,22),
					new OracleParameter(":RCYOL", OracleType.Float,22),
					new OracleParameter(":PHKSL", OracleType.Float,22),
					new OracleParameter(":PHDWZ1", OracleType.Float,22),
					new OracleParameter(":PHDWZ2", OracleType.Float,22),
					new OracleParameter(":PHDWZ3", OracleType.Float,22),
					new OracleParameter(":PHDWZ4", OracleType.Float,22),
					new OracleParameter(":PHKZL1", OracleType.Float,22),
					new OracleParameter(":PHKZL2", OracleType.Float,22),
					new OracleParameter(":PHKZL3", OracleType.Float,22),
					new OracleParameter(":PHKZL4", OracleType.Float,22),
					new OracleParameter(":BZ", OracleType.VarChar,300)};


            parameters[0].Value = model.WELLID;
            parameters[1].Value = model.KSSJ;
            parameters[2].Value = model.JCRQ;
            parameters[3].Value = model.JSSJ;
            parameters[4].Value = model.DDJEDGL;
            parameters[5].Value = model.DDJEDZS;
            parameters[6].Value = model.CYJCC;
            parameters[7].Value = model.CYJCCI;
            parameters[8].Value = model.SXDLMAX;
            parameters[9].Value = model.XXDLMAX;
            parameters[10].Value = model.DDZDZPHD;
            parameters[11].Value = model.SXYGPJZ;
            parameters[12].Value = model.XXYGPJZ;
            parameters[13].Value = model.YGPJZPHD;
            parameters[14].Value = model.SXYGMAX;
            parameters[15].Value = model.XXYGMAX;
            parameters[16].Value = model.YGZDZPHD;
            parameters[17].Value = model.SXNJJFG;
            parameters[18].Value = model.XXNJJFG;
            parameters[19].Value = model.NJJFGPHD;
            parameters[20].Value = model.RWGNH;
            parameters[21].Value = model.RYGZNH;
            parameters[22].Value = model.RYGFNH;
            parameters[23].Value = model.PJGLYS;
            parameters[24].Value = model.PJYGGL;
            parameters[25].Value = model.PJWGGL;
            parameters[26].Value = model.PJSZGL;
            parameters[27].Value = model.PJXDY;
            parameters[28].Value = model.PJXIDY;
            parameters[29].Value = model.YGFZL;
            parameters[30].Value = model.YGPZL;
            parameters[31].Value = model.NJFZL;
            parameters[32].Value = model.NJPZL;
            parameters[33].Value = model.DMXL;
            parameters[34].Value = model.XTXL;
            parameters[35].Value = model.DYNH;
            parameters[36].Value = model.RCYL;
            parameters[37].Value = model.BJ;
            parameters[38].Value = model.HS;
            parameters[39].Value = model.DYM;
            parameters[40].Value = model.CMD;
            parameters[41].Value = model.BX;
            parameters[42].Value = model.YY;
            parameters[43].Value = model.TY;
            parameters[44].Value = model.BS;
            parameters[45].Value = model.LLPL;
            parameters[46].Value = model.RCYOL;
            parameters[47].Value = model.PHKSL;
            parameters[48].Value = model.PHDWZ1;
            parameters[49].Value = model.PHDWZ2;
            parameters[50].Value = model.PHDWZ3;
            parameters[51].Value = model.PHDWZ4;
            parameters[52].Value = model.PHKZL1;
            parameters[53].Value = model.PHKZL2;
            parameters[54].Value = model.PHKZL3;
            parameters[55].Value = model.PHKZL4;
            parameters[56].Value = model.BZ;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(BDVALUEModel model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update BDVALUE set ");
            strSql.Append("WELLID=:WELLID,");
            strSql.Append("KSSJ=:KSSJ,");
            strSql.Append("JCRQ=:JCRQ,");
            strSql.Append("JSSJ=:JSSJ,");
            strSql.Append("DDJEDGL=:DDJEDGL,");
            strSql.Append("DDJEDZS=:DDJEDZS,");
            strSql.Append("CYJCC=:CYJCC,");
            strSql.Append("CYJCCI=:CYJCCI,");
            strSql.Append("SXDLMAX=:SXDLMAX,");
            strSql.Append("XXDLMAX=:XXDLMAX,");
            strSql.Append("DDZDZPHD=:DDZDZPHD,");
            strSql.Append("SXYGPJZ=:SXYGPJZ,");
            strSql.Append("XXYGPJZ=:XXYGPJZ,");
            strSql.Append("YGPJZPHD=:YGPJZPHD,");
            strSql.Append("SXYGMAX=:SXYGMAX,");
            strSql.Append("XXYGMAX=:XXYGMAX,");
            strSql.Append("YGZDZPHD=:YGZDZPHD,");
            strSql.Append("SXNJJFG=:SXNJJFG,");
            strSql.Append("XXNJJFG=:XXNJJFG,");
            strSql.Append("NJJFGPHD=:NJJFGPHD,");
            strSql.Append("RWGNH=:RWGNH,");
            strSql.Append("RYGZNH=:RYGZNH,");
            strSql.Append("RYGFNH=:RYGFNH,");
            strSql.Append("PJGLYS=:PJGLYS,");
            strSql.Append("PJYGGL=:PJYGGL,");
            strSql.Append("PJWGGL=:PJWGGL,");
            strSql.Append("PJSZGL=:PJSZGL,");
            strSql.Append("PJXDY=:PJXDY,");
            strSql.Append("PJXIDY=:PJXIDY,");
            strSql.Append("YGFZL=:YGFZL,");
            strSql.Append("YGPZL=:YGPZL,");
            strSql.Append("NJFZL=:NJFZL,");
            strSql.Append("NJPZL=:NJPZL,");
            strSql.Append("DMXL=:DMXL,");
            strSql.Append("XTXL=:XTXL,");
            strSql.Append("DYNH=:DYNH,");
            strSql.Append("RCYL=:RCYL,");
            strSql.Append("BJ=:BJ,");
            strSql.Append("HS=:HS,");
            strSql.Append("DYM=:DYM,");
            strSql.Append("CMD=:CMD,");
            strSql.Append("BX=:BX,");
            strSql.Append("YY=:YY,");
            strSql.Append("TY=:TY,");
            strSql.Append("BS=:BS,");
            strSql.Append("LLPL=:LLPL,");
            strSql.Append("RCYOL=:RCYOL,");
            strSql.Append("PHKSL=:PHKSL,");
            strSql.Append("PHDWZ1=:PHDWZ1,");
            strSql.Append("PHDWZ2=:PHDWZ2,");
            strSql.Append("PHDWZ3=:PHDWZ3,");
            strSql.Append("PHDWZ4=:PHDWZ4,");
            strSql.Append("PHKZL1=:PHKZL1,");
            strSql.Append("PHKZL2=:PHKZL2,");
            strSql.Append("PHKZL3=:PHKZL3,");
            strSql.Append("PHKZL4=:PHKZL4,");
            strSql.Append("BZ=:BZ");
            strSql.Append(" where ID=:ID ");
            OracleParameter[] parameters = {
					new OracleParameter(":WELLID", OracleType.VarChar,30),
					new OracleParameter(":KSSJ", OracleType.DateTime),
					new OracleParameter(":JCRQ", OracleType.DateTime),
					new OracleParameter(":JSSJ", OracleType.DateTime),
					new OracleParameter(":DDJEDGL", OracleType.Float,22),
					new OracleParameter(":DDJEDZS", OracleType.Float,22),
					new OracleParameter(":CYJCC", OracleType.Float,22),
					new OracleParameter(":CYJCCI", OracleType.Float,22),
					new OracleParameter(":SXDLMAX", OracleType.Float,22),
					new OracleParameter(":XXDLMAX", OracleType.Float,22),
					new OracleParameter(":DDZDZPHD", OracleType.Float,22),
					new OracleParameter(":SXYGPJZ", OracleType.Float,22),
					new OracleParameter(":XXYGPJZ", OracleType.Float,22),
					new OracleParameter(":YGPJZPHD", OracleType.Float,22),
					new OracleParameter(":SXYGMAX", OracleType.Float,22),
					new OracleParameter(":XXYGMAX", OracleType.Float,22),
					new OracleParameter(":YGZDZPHD", OracleType.Float,22),
					new OracleParameter(":SXNJJFG", OracleType.Float,22),
					new OracleParameter(":XXNJJFG", OracleType.Float,22),
					new OracleParameter(":NJJFGPHD", OracleType.Float,22),
					new OracleParameter(":RWGNH", OracleType.Float,22),
					new OracleParameter(":RYGZNH", OracleType.Float,22),
					new OracleParameter(":RYGFNH", OracleType.Float,22),
					new OracleParameter(":PJGLYS", OracleType.Float,22),
					new OracleParameter(":PJYGGL", OracleType.Float,22),
					new OracleParameter(":PJWGGL", OracleType.Float,22),
					new OracleParameter(":PJSZGL", OracleType.Float,22),
					new OracleParameter(":PJXDY", OracleType.Float,22),
					new OracleParameter(":PJXIDY", OracleType.Float,22),
					new OracleParameter(":YGFZL", OracleType.Float,22),
					new OracleParameter(":YGPZL", OracleType.Float,22),
					new OracleParameter(":NJFZL", OracleType.Float,22),
					new OracleParameter(":NJPZL", OracleType.Float,22),
					new OracleParameter(":DMXL", OracleType.Float,22),
					new OracleParameter(":XTXL", OracleType.Float,22),
					new OracleParameter(":DYNH", OracleType.Float,22),
					new OracleParameter(":RCYL", OracleType.Float,22),
                    new OracleParameter(":BJ", OracleType.Float,22),
					new OracleParameter(":HS", OracleType.Float,22),
					new OracleParameter(":DYM", OracleType.Float,22),
					new OracleParameter(":CMD", OracleType.Float,22),
					new OracleParameter(":BX", OracleType.Float,22),
					new OracleParameter(":YY", OracleType.Float,22),
					new OracleParameter(":TY", OracleType.Float,22),
					new OracleParameter(":BS", OracleType.Float,22),
					new OracleParameter(":LLPL", OracleType.Float,22),
					new OracleParameter(":RCYOL", OracleType.Float,22),
					new OracleParameter(":PHKSL", OracleType.Float,22),
					new OracleParameter(":PHDWZ1", OracleType.Float,22),
					new OracleParameter(":PHDWZ2", OracleType.Float,22),
					new OracleParameter(":PHDWZ3", OracleType.Float,22),
					new OracleParameter(":PHDWZ4", OracleType.Float,22),
					new OracleParameter(":PHKZL1", OracleType.Float,22),
					new OracleParameter(":PHKZL2", OracleType.Float,22),
					new OracleParameter(":PHKZL3", OracleType.Float,22),
					new OracleParameter(":PHKZL4", OracleType.Float,22),
					new OracleParameter(":BZ", OracleType.VarChar,300),
					new OracleParameter(":ID", OracleType.Number,18)};
            parameters[0].Value = model.WELLID;
            parameters[1].Value = model.KSSJ;
            parameters[2].Value = model.JCRQ;
            parameters[3].Value = model.JSSJ;
            parameters[4].Value = model.DDJEDGL;
            parameters[5].Value = model.DDJEDZS;
            parameters[6].Value = model.CYJCC;
            parameters[7].Value = model.CYJCCI;
            parameters[8].Value = model.SXDLMAX;
            parameters[9].Value = model.XXDLMAX;
            parameters[10].Value = model.DDZDZPHD;
            parameters[11].Value = model.SXYGPJZ;
            parameters[12].Value = model.XXYGPJZ;
            parameters[13].Value = model.YGPJZPHD;
            parameters[14].Value = model.SXYGMAX;
            parameters[15].Value = model.XXYGMAX;
            parameters[16].Value = model.YGZDZPHD;
            parameters[17].Value = model.SXNJJFG;
            parameters[18].Value = model.XXNJJFG;
            parameters[19].Value = model.NJJFGPHD;
            parameters[20].Value = model.RWGNH;
            parameters[21].Value = model.RYGZNH;
            parameters[22].Value = model.RYGFNH;
            parameters[23].Value = model.PJGLYS;
            parameters[24].Value = model.PJYGGL;
            parameters[25].Value = model.PJWGGL;
            parameters[26].Value = model.PJSZGL;
            parameters[27].Value = model.PJXDY;
            parameters[28].Value = model.PJXIDY;
            parameters[29].Value = model.YGFZL;
            parameters[30].Value = model.YGPZL;
            parameters[31].Value = model.NJFZL;
            parameters[32].Value = model.NJPZL;
            parameters[33].Value = model.DMXL;
            parameters[34].Value = model.XTXL;
            parameters[35].Value = model.DYNH;
            parameters[36].Value = model.RCYL;
            parameters[37].Value = model.BJ;
            parameters[38].Value = model.HS;
            parameters[39].Value = model.DYM;
            parameters[40].Value = model.CMD;
            parameters[41].Value = model.BX;
            parameters[42].Value = model.YY;
            parameters[43].Value = model.TY;
            parameters[44].Value = model.BS;
            parameters[45].Value = model.LLPL;
            parameters[46].Value = model.RCYOL;
            parameters[47].Value = model.PHKSL;
            parameters[48].Value = model.PHDWZ1;
            parameters[49].Value = model.PHDWZ2;
            parameters[50].Value = model.PHDWZ3;
            parameters[51].Value = model.PHDWZ4;
            parameters[52].Value = model.PHKZL1;
            parameters[53].Value = model.PHKZL2;
            parameters[54].Value = model.PHKZL3;
            parameters[55].Value = model.PHKZL4;
            parameters[56].Value = model.BZ;
            parameters[57].Value = model.ID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(decimal ID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from BDVALUE ");
            strSql.Append(" where ID=:ID ");
            OracleParameter[] parameters = {
					new OracleParameter(":ID", OracleType.Number,22)			};
            parameters[0].Value = ID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteList(string IDlist)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from BDVALUE ");
            strSql.Append(" where ID in (" + IDlist + ")  ");
            int rows = DbHelperOra.ExecuteSql(strSql.ToString());
            if (rows > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BDVALUEModel GetModel(decimal ID)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ID,WELLID,KSSJ,JCRQ,JSSJ,DDJEDGL,DDJEDZS,CYJCC,CYJCCI,SXDLMAX,XXDLMAX,DDZDZPHD,SXYGPJZ,XXYGPJZ,YGPJZPHD,SXYGMAX,XXYGMAX,YGZDZPHD,SXNJJFG,XXNJJFG,NJJFGPHD,RWGNH,RYGZNH,RYGFNH,PJGLYS,PJYGGL,PJWGGL,PJSZGL,PJXDY,PJXIDY,YGFZL,YGPZL,NJFZL,NJPZL,DMXL,XTXL,DYNH,RCYL,BJ,HS,DYM,CMD,BX,YY,TY,BS,LLPL,RCYOL,PHKSL,PHDWZ1,PHDWZ2,PHDWZ3,PHDWZ4,PHKZL1,PHKZL2,PHKZL3,PHKZL4,BZ from BDVALUE ");
            strSql.Append(" where ID=:ID ");
            OracleParameter[] parameters = {
					new OracleParameter(":ID", OracleType.Number,22)			};
            parameters[0].Value = ID;

            BDVALUEModel model = new BDVALUEModel();
            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BDVALUEModel DataRowToModel(DataRow row)
        {
            BDVALUEModel model = new BDVALUEModel();
            if (row != null)
            {
                if (row["ID"] != null && row["ID"].ToString() != "")
                {
                    model.ID = decimal.Parse(row["ID"].ToString());
                }
                if (row["WELLID"] != null)
                {
                    model.WELLID = row["WELLID"].ToString();
                }
                if (row["KSSJ"] != null && row["KSSJ"].ToString() != "")
                {
                    model.KSSJ = DateTime.Parse(row["KSSJ"].ToString());
                }
                if (row["JCRQ"] != null && row["JCRQ"].ToString() != "")
                {
                    model.JCRQ = DateTime.Parse(row["JCRQ"].ToString());
                }
                if (row["JSSJ"] != null && row["JSSJ"].ToString() != "")
                {
                    model.JSSJ = DateTime.Parse(row["JSSJ"].ToString());
                }
                if (row["DDJEDGL"] != null && row["DDJEDGL"].ToString() != "")
                {
                    model.DDJEDGL = decimal.Parse(row["DDJEDGL"].ToString());
                }
                if (row["DDJEDZS"] != null && row["DDJEDZS"].ToString() != "")
                {
                    model.DDJEDZS = decimal.Parse(row["DDJEDZS"].ToString());
                }
                if (row["CYJCC"] != null && row["CYJCC"].ToString() != "")
                {
                    model.CYJCC = decimal.Parse(row["CYJCC"].ToString());
                }
                if (row["CYJCCI"] != null && row["CYJCCI"].ToString() != "")
                {
                    model.CYJCCI = decimal.Parse(row["CYJCCI"].ToString());
                }
                if (row["SXDLMAX"] != null && row["SXDLMAX"].ToString() != "")
                {
                    model.SXDLMAX = decimal.Parse(row["SXDLMAX"].ToString());
                }
                if (row["XXDLMAX"] != null && row["XXDLMAX"].ToString() != "")
                {
                    model.XXDLMAX = decimal.Parse(row["XXDLMAX"].ToString());
                }
                if (row["DDZDZPHD"] != null && row["DDZDZPHD"].ToString() != "")
                {
                    model.DDZDZPHD = decimal.Parse(row["DDZDZPHD"].ToString());
                }
                if (row["SXYGPJZ"] != null && row["SXYGPJZ"].ToString() != "")
                {
                    model.SXYGPJZ = decimal.Parse(row["SXYGPJZ"].ToString());
                }
                if (row["XXYGPJZ"] != null && row["XXYGPJZ"].ToString() != "")
                {
                    model.XXYGPJZ = decimal.Parse(row["XXYGPJZ"].ToString());
                }
                if (row["YGPJZPHD"] != null && row["YGPJZPHD"].ToString() != "")
                {
                    model.YGPJZPHD = decimal.Parse(row["YGPJZPHD"].ToString());
                }
                if (row["SXYGMAX"] != null && row["SXYGMAX"].ToString() != "")
                {
                    model.SXYGMAX = decimal.Parse(row["SXYGMAX"].ToString());
                }
                if (row["XXYGMAX"] != null && row["XXYGMAX"].ToString() != "")
                {
                    model.XXYGMAX = decimal.Parse(row["XXYGMAX"].ToString());
                }
                if (row["YGZDZPHD"] != null && row["YGZDZPHD"].ToString() != "")
                {
                    model.YGZDZPHD = decimal.Parse(row["YGZDZPHD"].ToString());
                }
                if (row["SXNJJFG"] != null && row["SXNJJFG"].ToString() != "")
                {
                    model.SXNJJFG = decimal.Parse(row["SXNJJFG"].ToString());
                }
                if (row["XXNJJFG"] != null && row["XXNJJFG"].ToString() != "")
                {
                    model.XXNJJFG = decimal.Parse(row["XXNJJFG"].ToString());
                }
                if (row["NJJFGPHD"] != null && row["NJJFGPHD"].ToString() != "")
                {
                    model.NJJFGPHD = decimal.Parse(row["NJJFGPHD"].ToString());
                }
                if (row["RWGNH"] != null && row["RWGNH"].ToString() != "")
                {
                    model.RWGNH = decimal.Parse(row["RWGNH"].ToString());
                }
                if (row["RYGZNH"] != null && row["RYGZNH"].ToString() != "")
                {
                    model.RYGZNH = decimal.Parse(row["RYGZNH"].ToString());
                }
                if (row["RYGFNH"] != null && row["RYGFNH"].ToString() != "")
                {
                    model.RYGFNH = decimal.Parse(row["RYGFNH"].ToString());
                }
                if (row["PJGLYS"] != null && row["PJGLYS"].ToString() != "")
                {
                    model.PJGLYS = decimal.Parse(row["PJGLYS"].ToString());
                }
                if (row["PJYGGL"] != null && row["PJYGGL"].ToString() != "")
                {
                    model.PJYGGL = decimal.Parse(row["PJYGGL"].ToString());
                }
                if (row["PJWGGL"] != null && row["PJWGGL"].ToString() != "")
                {
                    model.PJWGGL = decimal.Parse(row["PJWGGL"].ToString());
                }
                if (row["PJSZGL"] != null && row["PJSZGL"].ToString() != "")
                {
                    model.PJSZGL = decimal.Parse(row["PJSZGL"].ToString());
                }
                if (row["PJXDY"] != null && row["PJXDY"].ToString() != "")
                {
                    model.PJXDY = decimal.Parse(row["PJXDY"].ToString());
                }
                if (row["PJXIDY"] != null && row["PJXIDY"].ToString() != "")
                {
                    model.PJXIDY = decimal.Parse(row["PJXIDY"].ToString());
                }
                if (row["YGFZL"] != null && row["YGFZL"].ToString() != "")
                {
                    model.YGFZL = decimal.Parse(row["YGFZL"].ToString());
                }
                if (row["YGPZL"] != null && row["YGPZL"].ToString() != "")
                {
                    model.YGPZL = decimal.Parse(row["YGPZL"].ToString());
                }
                if (row["NJFZL"] != null && row["NJFZL"].ToString() != "")
                {
                    model.NJFZL = decimal.Parse(row["NJFZL"].ToString());
                }
                if (row["NJPZL"] != null && row["NJPZL"].ToString() != "")
                {
                    model.NJPZL = decimal.Parse(row["NJPZL"].ToString());
                }
                if (row["DMXL"] != null && row["DMXL"].ToString() != "")
                {
                    model.DMXL = decimal.Parse(row["DMXL"].ToString());
                }
                if (row["XTXL"] != null && row["XTXL"].ToString() != "")
                {
                    model.XTXL = decimal.Parse(row["XTXL"].ToString());
                }
                if (row["DYNH"] != null && row["DYNH"].ToString() != "")
                {
                    model.DYNH = decimal.Parse(row["DYNH"].ToString());
                }
                if (row["RCYL"] != null && row["RCYL"].ToString() != "")
                {
                    model.RCYL = decimal.Parse(row["RCYL"].ToString());
                }
                if (row["BJ"] != null && row["BJ"].ToString() != "")
                {
                    model.BJ = decimal.Parse(row["BJ"].ToString());
                }
                if (row["HS"] != null && row["HS"].ToString() != "")
                {
                    model.HS = decimal.Parse(row["HS"].ToString());
                }
                if (row["DYM"] != null && row["DYM"].ToString() != "")
                {
                    model.DYM = decimal.Parse(row["DYM"].ToString());
                }
                if (row["CMD"] != null && row["CMD"].ToString() != "")
                {
                    model.CMD = decimal.Parse(row["CMD"].ToString());
                }
                if (row["BX"] != null && row["BX"].ToString() != "")
                {
                    model.BX = decimal.Parse(row["BX"].ToString());
                }
                if (row["YY"] != null && row["YY"].ToString() != "")
                {
                    model.YY = decimal.Parse(row["YY"].ToString());
                }
                if (row["TY"] != null && row["TY"].ToString() != "")
                {
                    model.TY = decimal.Parse(row["TY"].ToString());
                }
                if (row["BS"] != null && row["BS"].ToString() != "")
                {
                    model.BS = decimal.Parse(row["BS"].ToString());
                }
                if (row["LLPL"] != null && row["LLPL"].ToString() != "")
                {
                    model.LLPL = decimal.Parse(row["LLPL"].ToString());
                }
                if (row["RCYOL"] != null && row["RCYOL"].ToString() != "")
                {
                    model.RCYOL = decimal.Parse(row["RCYOL"].ToString());
                }
                if (row["PHKSL"] != null && row["PHKSL"].ToString() != "")
                {
                    model.PHKSL = decimal.Parse(row["PHKSL"].ToString());
                }
                if (row["PHDWZ1"] != null && row["PHDWZ1"].ToString() != "")
                {
                    model.PHDWZ1 = decimal.Parse(row["PHDWZ1"].ToString());
                }
                if (row["PHDWZ2"] != null && row["PHDWZ2"].ToString() != "")
                {
                    model.PHDWZ2 = decimal.Parse(row["PHDWZ2"].ToString());
                }
                if (row["PHDWZ3"] != null && row["PHDWZ3"].ToString() != "")
                {
                    model.PHDWZ3 = decimal.Parse(row["PHDWZ3"].ToString());
                }
                if (row["PHDWZ4"] != null && row["PHDWZ4"].ToString() != "")
                {
                    model.PHDWZ4 = decimal.Parse(row["PHDWZ4"].ToString());
                }
                if (row["PHKZL1"] != null && row["PHKZL1"].ToString() != "")
                {
                    model.PHKZL1 = decimal.Parse(row["PHKZL1"].ToString());
                }
                if (row["PHKZL2"] != null && row["PHKZL2"].ToString() != "")
                {
                    model.PHKZL2 = decimal.Parse(row["PHKZL2"].ToString());
                }
                if (row["PHKZL3"] != null && row["PHKZL3"].ToString() != "")
                {
                    model.PHKZL3 = decimal.Parse(row["PHKZL3"].ToString());
                }
                if (row["PHKZL4"] != null && row["PHKZL4"].ToString() != "")
                {
                    model.PHKZL4 = decimal.Parse(row["PHKZL4"].ToString());
                }
                if (row["BZ"] != null)
                {
                    model.BZ = row["BZ"].ToString();
                }
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ID,WELLID,KSSJ,JCRQ,JSSJ,DDJEDGL,DDJEDZS,CYJCC,CYJCCI,SXDLMAX,XXDLMAX,DDZDZPHD,SXYGPJZ,XXYGPJZ,YGPJZPHD,SXYGMAX,XXYGMAX,YGZDZPHD,SXNJJFG,XXNJJFG,NJJFGPHD,RWGNH,RYGZNH,RYGFNH,PJGLYS,PJYGGL,PJWGGL,PJSZGL,PJXDY,PJXIDY,YGFZL,YGPZL,NJFZL,NJPZL,DMXL,XTXL,DYNH,RCYL,BJ,HS,DYM,CMD,BX,YY,TY,BS,LLPL,RCYOL,PHKSL,PHDWZ1,PHDWZ2,PHDWZ3,PHDWZ4,PHKZL1,PHKZL2,PHKZL3,PHKZL4,BZ ");
            strSql.Append(" FROM BDVALUE ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperOra.Query(strSql.ToString());
        }
        /// <summary>
        /// 通过用户自定义SQL语句获得数据列表
        /// </summary>
        public DataSet GetList_SQL(string strsql)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(strsql);
            return DbHelperOra.Query(strSql.ToString());
        }
        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) FROM BDVALUE ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            object obj = DbHelperSQL.GetSingle(strSql.ToString());
            if (obj == null)
            {
                return 0;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT * FROM ( ");
            strSql.Append(" SELECT ROW_NUMBER() OVER (");
            if (!string.IsNullOrEmpty(orderby.Trim()))
            {
                strSql.Append("order by T." + orderby);
            }
            else
            {
                strSql.Append("order by T.ID desc");
            }
            strSql.Append(")AS Row, T.*  from BDVALUE T ");
            if (!string.IsNullOrEmpty(strWhere.Trim()))
            {
                strSql.Append(" WHERE " + strWhere);
            }
            strSql.Append(" ) TT");
            strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
            return DbHelperOra.Query(strSql.ToString());
        }

        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            OracleParameter[] parameters = {
                    new OracleParameter(":tblName", OracleType.VarChar, 255),
                    new OracleParameter(":fldName", OracleType.VarChar, 255),
                    new OracleParameter(":PageSize", OracleType.Number),
                    new OracleParameter(":PageIndex", OracleType.Number),
                    new OracleParameter(":IsReCount", OracleType.Clob),
                    new OracleParameter(":OrderType", OracleType.Clob),
                    new OracleParameter(":strWhere", OracleType.VarChar,1000),
                    };
            parameters[0].Value = "BDVALUE";
            parameters[1].Value = "ID";
            parameters[2].Value = PageSize;
            parameters[3].Value = PageIndex;
            parameters[4].Value = 0;
            parameters[5].Value = 0;
            parameters[6].Value = strWhere;	
            return DbHelperOra.RunProcedure("UP_GetRecordByPage",parameters,"ds");
        }*/

        /// <summary>
        /// 采用事务更新表数据
        /// </summary>
        /// <param name="dt">表数据</param>
        /// <param name="TableName">表名称</param>
        /// <returns></returns>
        public bool TransUpdateTable(DataTable dt)
        {
            return DbHelperOra.TransUpdateTable(dt, "BDVALUE");
        }
        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

